﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFileDialog>
#include <QDebug>
#include <QFile>
#include <QTextStream>
#include "student.h"
#include <QStandardItemModel>
#include <QMessageBox>
#include "dialog.h"
#include "output1.h"
#include "output2.h"
#include "output3.h"
#include "output4.h"
#include "output5.h"
#include <QMap>
#include "output6.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void onAppendStudent(QString classId,QString id,QString name ,QString className,QString score,QString reScore,int seme);
    void onOutPut1(QString className,QString filePath);
    void onOutPut2(QString className,QString savePath);
    void onOutPut3(QString className,QString filePath);
    void onOutPut4(QString studentName,int seme,QString filePath);
    void onOutPut5(QString className,QString filePath);
    void onOutPut6(QString className,QString classid,QString filePath);

private slots:
    void on_actOpen_triggered();

    void on_combSemester_currentIndexChanged(int index);

    void on_checkBox_stateChanged(int arg1);

    void on_btnAppend_clicked();

    void on_btnDelete_clicked();

    void on_actSave_triggered();

    void on_btnOutput1_clicked();

    void on_btnOutput2_clicked();

    void on_btnOutput3_clicked();

    void on_btnOutput4_clicked();

    void on_btnOutput5_clicked();

    void on_btnOutput6_clicked();

private:
    Ui::MainWindow *ui;

    QList<student*> m_students;//学生列表
    QStringList m_classNames;//课程总览
    QStringList m_classIds;//班级号总览
    QStringList m_studentNames;//学生姓名列表

    QStandardItemModel* m_dataModel;//数据模型

    void init();//初始化函数
    void updataClassNames();//更新课程总览列表
    void updataClassIds();//更新班级号总览列表
    void updataStudentNames();//更新学生姓名列表
};
#endif // MAINWINDOW_H
